package ua.kpi_java_training.tyshchenko.module2;

import java.util.*;

/**
 * This wrap class contains list of creatures
 *
 * @author Vlad Tyshchenko
 * @version 1.1 15 June 2013
 */
public class ListCreature {
    private List<CreatureInHabitat> creatureList;

    /**
     * The constructor creates list of creature in habitat
     *
     * @param creature       - shows type of creatureInHabitat in list
     * @param amountCreature
     */
    public ListCreature(CreatureInHabitat creature, int amountCreature) {
        creatureList = new ArrayList<CreatureInHabitat>();
        for (int i = 0; i < amountCreature; i++) {
            creatureList.add(creature.getNewFish());
        }
    }

    public int size() {
        return creatureList.size();
    }

    public CreatureInHabitat getCreature(int index) {
        return creatureList.get(index);
    }

    public void add(CreatureInHabitat creature) {
        creatureList.add(creature);
    }

    public void remove(CreatureInHabitat creature) {
        creatureList.remove(creature);
    }
}
